package org.game.db.proxy.bean;

import com.sojoys.artifact.build.data.base.BasePojoProxy;
import org.cfg.RechargeGiftBagCfg;
import org.cfg.cache.RechargeGiftBagCfgCache;
import org.game.db.bean.RechargeGiftBagRecord;

import java.util.Date;

/**
 * Created by fxf on 2018-2-5.
 */
public class RechargeGiftBagRecordProxy extends BasePojoProxy<RechargeGiftBagRecordProxy, RechargeGiftBagRecord> {

    public RechargeGiftBagCfg getCfg() {
        return RechargeGiftBagCfgCache.me().getById(t.getCid());
    }

    public void reset() {
        t.setBuyCount(0)
                .setLastRefreshDate(new Date());
        t.update();
    }
}

